.TH std::experimental::observer_ptr 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::experimental::observer_ptr \- std::experimental::observer_ptr

.SH Synopsis
   Defined in header <experimental/memory>
   template< class W >                      (library fundamentals TS v2)
   class observer_ptr;

   std::experimental::observer_ptr is a non-owning pointer, or observer. The observer
   stores a pointer to a second object, known as the watched object. An observer_ptr
   may also have no watched object.

   An observer is not responsible in any way for the watched object; there is no
   inherent relationship between an observer and the object it watches.

   It is intended as a near drop-in replacement for raw pointer types, with the
   advantage that, as a vocabulary type, it indicates its intended use without need for
   detailed analysis by code readers.

   Specializations of observer_ptr satisfy the requirements of CopyConstructible and
   CopyAssignable.

.SH Type requirements
   -
   W shall not be a reference type, but may be an incomplete type.

.SH Member types

   Member type  Definition
   element_type W, the type of the object watched by this observer_ptr

.SH Member functions

   constructor            constructs a new observer_ptr
                          \fI(public member function)\fP
   destructor             destructs an observer_ptr
   (implicitly declared)  \fI(public member function)\fP
   operator=              implicitly declared copy and move assignment operators that
   (implicitly declared)  assign the stored pointer
                          \fI(public member function)\fP
.SH Modifiers
                          returns a pointer to the watched object and stops watching
   release                the object
                          \fI(public member function)\fP
   reset                  replaces the watched object
                          \fI(public member function)\fP
   swap                   swaps the watched objects
                          \fI(public member function)\fP
.SH Observers
   get                    returns a pointer to the watched object
                          \fI(public member function)\fP
   operator bool          checks if there is an associated watched object
                          \fI(public member function)\fP
   operator*              dereferences pointer to the watched object
   operator->             \fI(public member function)\fP
.SH Conversions
   operator element_type* explicit conversion function to the stored pointer
                          \fI(public member function)\fP

.SH Non-member functions

                                                            creates an observer_ptr
   make_observer                                            that watches an object
                                                            \fI(function template)\fP
   operator==
   operator!=                                               compares to another
   operator<                                                observer_ptr or with
   operator<=                                               nullptr
   operator>                                                \fI(function template)\fP
   operator>=
                                                            specializes the swap
   std::experimental::swap(std::experimental::observer_ptr) algorithm
                                                            \fI(function template)\fP

.SH Helper classes

   std::hash<std::experimental::observer_ptr> hash support for observer_ptr
                                              \fI(class template specialization)\fP

.SH Example

    This section is incomplete
    Reason: no example

.SH Category:
     * Todo no example
